using System;
using System.Reflection;
namespace HotUpdate
{
    [AttributeUsage(AttributeTargets.Method,AllowMultiple =true,Inherited =true)]
    public class EventHandlerAttribute:Attribute
    {
        public int EventID { get; private set; }
        public EventHandlerAttribute(Type eventType,string eventIDName= "EventId")
        {
            var p = eventType.GetField(eventIDName, BindingFlags.Public|BindingFlags.Static);
            if (p != null)
            {
                
                EventID = (int)p.GetValue(null);
            }else
            {
                EventID = 0;
            }            
        }
    }
}

